'''
邮件页面
'''
from selenium.webdriver.common.by import By
from page.base_page import BasePage

class YingjianShouye(BasePage):
    url = 'http://192.168.1.25/crm/index.php?m=setting&a=sendemail'

    # 输入邮箱
    shuruyouxaing_locator = (By.CSS_SELECTOR, '#emails')
    # 输入主题
    zhuti_locator = (By.CSS_SELECTOR, '#title')
    # 输入标题
    nr_lovator = (By.CSS_SELECTOR,'body > div.container > div.row > div:nth-child(2) > form > div > div:nth-child(2) > div:nth-child(3) > div > div.ke-edit > iframe')
    # 发送邮件
    faso_locator = (By.CSS_SELECTOR,'body > div.container > div.row > div:nth-child(2) > form > div > div:nth-child(2) > div:nth-child(3) > input')

    def shuruyouxiang(self,youxiang):
        self.driver.find_element(*self.shuruyouxaing_locator).send_keys(youxiang)

    def shuruzhuti(self,zhuti):
        self.driver.find_element(*self.zhuti_locator).send_keys(zhuti)

    def shurubiaoti(self,neirong):
        self.driver.find_element(*self.nr_lovator).send_keys(neirong)

    def fasongyoujian(self):
        self.driver.find_element(*self.faso_locator).click()